package com.wasion.pwportable.protocol.analyzer.indicator;

import com.wasion.pwportable.protocol.Protocol;
import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

/**
 * 
 * @ClassName: ZeroSequence_RD_Analyzer
 * @Description: 2A/2B. 电缆指示器零序故障判断参数
 * @author 高意
 * @date 2014-9-10 下午4:48:56
 * 
 */
public class ZeroSequence_RD_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {

		String data = ackBS.substring(DATABITSTART, DATABITSTART + 2);
		int currentInt = Integer.parseInt(data, 16)
				* Protocol.GROUND_CUT_CURRENTREF;
		result.setGroundCut(currentInt);

		data = ackBS.substring(DATABITSTART + 2, DATABITSTART + 6);
		String cutOffTime = data.substring(2, 4) + data.substring(0, 2);
		int cTimeInt = Integer.parseInt(cutOffTime, 16);
		result.setGroundCutTime(cTimeInt);

		data = ackBS.substring(DATABITSTART + 6, DATABITSTART + 8);
		int overCurrentInt = Integer.parseInt(data, 16)
				* Protocol.GROUND_CUT_CURRENTREF;
		result.setGroundOverFlow(overCurrentInt);

		data = ackBS.substring(DATABITSTART + 8, DATABITSTART + 12);
		String overTime = data.substring(2, 4) + data.substring(0, 2);
		int oTimeInt = Integer.parseInt(overTime, 16);
		result.setGroundOverFlowTime(oTimeInt);
	}
}
